#ifndef _SEU_COOKIEMANAGER_H_
#define _SEU_COOKIEMANAGER_H_
#include"include.h"

/* A cookiemanager_t is used when one wants to generate unique keys for sets
 * of data. This particular cookie manager returns unique 32 bit keys. Cookies
 * can also be released back to the system when they are no longer in use.
 *
 * This implementation of a cookie manager is thread-safe.
 */

typedef struct {
   uint32_t count;
   list_t *unused;
} cookiemanage_t;

cookiemanage_t *cookiemanageInit();
void cookiemanageCleanup(cookiemanage_t *);

uint32_t cookiemanageNewCookie(cookiemanage_t *);
void cookiemanageReleaseCookie(cookiemanage_t *, uint32_t);

#endif
